package com.hwang.demo3;

import java.util.Scanner;

public class auto_mark {
    public static void main(String[] args) {
        char[] answer = {'A', 'B', 'C', 'A', 'D'};
        char[] youanswer = new char[answer.length];

        int score = 0;
        Scanner sc = new Scanner(System.in);

        for (int i = 0;i<answer.length;i++){
            System.out.println("请输入第" + (i+1) +"题的答案：");
            char ch = sc.next().toCharArray()[0];
            youanswer[i] = ch;

            if (answer[i] == youanswer[i]){
                score++;
            }
        }

        // 单选题，每题2分
        System.out.println("单选题，每题2分,最终得分为：" + score * 2);

    }
}
